<?php
$con = mysql_connect("localhost","root","root");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }

mysql_select_db("comld", $con);
$dateTime = date("Y-m-d",strtotime("-1 day"));

mysql_query("DELETE FROM comld_query WHERE FirstLoginTime< '2012-03-27' or FirstLoginTime >'$dateTime'");
mysql_query("DELETE FROM comld_query WHERE whatdate< '2012-03-27' or whatdate >'$dateTime'");
mysql_close($con);
?>